﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using PPI.Data.Inspection;
using PPI.Entities.Interface;
using PPI.Mobile;

namespace PPI.ServiceLogic.Inspections
{
    public class LInspectionResultType : IMobileTable
    {
        public static DataSet SelectAllIdName(string connectionKey)
        {
            return DInspectionResultType.SelectAllIdName(connectionKey);
        }

        public List<EMobileQuery> CreateInsertMobileQuery(string connectionKey)
        {
            List<EMobileQuery> listQueries = new List<EMobileQuery>();
            listQueries.Add(new EMobileQuery("Delete tb_ResultTypes"));

            DataTable dt = SelectAllIdName(connectionKey).Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                //dr["Inspection_ResultTypeId"]
                //dr["Name"]
                listQueries.Add(new EMobileQuery("Insert into tb_ResultTypes(ResultTypeId,Name) values(" + dr["Vendor_InspVisit_XmissionStructures_ResultTypeId"] + ",'" + dr["Name"] + "') "));
            }

            return listQueries;
        }
    }
}
